#include<iostream>
using namespace std;

long long fact(long long n);

int main()
{
	long long n;
	cin >> n;
	long long sum = 0;
	for (int i = 1; i <= n; i++)
	{
		sum += fact(i);
	}
	
	cout << sum << endl; 
	
	return 0;
}

long long fact(long long n)
{
	if (n == 1)
		return 1;
	else
		return n * fact(n - 1);
}
